<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link href="../../libs/mui.min.css" rel="stylesheet"/>
    <link href="../../libs/app.css" rel="stylesheet"/>
    <link href="../../css/main.css" rel="stylesheet"/>
    <link href="../../css/assess-d.css" rel="stylesheet"/>
</head>
<body>
<div class="head">
    <img class="mui-action-back" src="../../images/all-left.png" alt="">
    <p>房产抵押贷</p>
</div>
<div class="content">
    <!--列表-->
    <div class="list">

        <!--房产类别-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <a href="#showlx">
                    <div class="lx-le">房产类别</div>
                    <div id="info-lx" class="lx-ri type-info">选择</div>
                </a>
            </div>
        </div>
        <div id="showlx" class="showlx mui-popover mui-popover-action mui-popover-bottom">
            <ul class="mui-table-view insurance-type">
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">商品楼</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">写字楼</a>
                </li>

                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">商铺</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">工业厂房</a>
                </li>
            </ul>
            <ul class="mui-table-view ">
                <li class="mui-table-view-cell popover-bottom-remove">
                    <a href="#showlx">取消</a>
                </li>
            </ul>
        </div>
        <!--房产楼龄-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <div class="lx-le">房产楼龄</div>
                <div class="lx-ri">
                    <input class="bd-ri year" placeholder="单行输入" value="" type="number"/>
                    <span class="bd-m">年</span>
                </div>
            </div>
        </div>

        <!--还款期限期-->
        <!--<div id="xl-y" class=" mui-table-view">
            <div class="mui-table-view-cell">
                <a href="#already-pm">
                    <div class="lx-le">还款期限期</div>
                    <div id="payment-y" class="payment lx-ri infoone-qx">选择</div>
                </a>
            </div>
        </div>
        <div id="already-pm" class="payment-y mui-popover mui-popover-action mui-popover-bottom">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">60期</span>
                    </a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">120期</a>
                </li>

            </ul>
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom-remove">
                    <a href="#already-pm">取消</a>
                </li>
            </ul>
        </div>-->
        <!--房产估值-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <div class="lx-le">房产估值</div>
                <div class="lx-ri">
                    <input class="bd-ri mr2em price" placeholder="单行输入" value="" type="number"/>
                    <span class="bd-m">万元</span>
                </div>
            </div>
        </div>

    </div>
    <!--按钮-->
    <div class="buttons">
        <!--<div class="add add-button">继续添加</div>-->
        <div class="add add-submit" id="evaluate">提交</div>
    </div>
</div>
<script src="../../libs/mui.min.js"></script>
<script src="../../js/jquery-3.1.1.min.js"></script>
<script src="../../js/url.js"></script>
<script src="../../js/assess-public.js"></script>
<script>
    $(function () {
//        var hold = plus.webview.currentWebview().hold; todo
//        hold && $.closePages([hold]);
    });

    //判断是否从申请页过来
    localStorage.isAssess === 'fcdy' ? mui.toast('请您先进行该项评估！') : '';
    localStorage.isAssess = '';
    var params = new ToArr();
    $('#evaluate').on('tap', function () {
        //各参数数组
        var type = params.getType('.type-info');
        var year = params.rechange('.year');
        var price = params.rechange('.price');
//				var stage = params.rechange('.infoone-qx', "期");

        //将各参数数组转换成符合格式的请求参数
        var arrObj = {type: type, year: year, price: price};//, stage: stage
        var resParam = params.getParams(arrObj);

        var nian = /^[1-9]\d*$/;
        var yuan = /^[0-9]+(.[0-9]{1,4})?$/;

        for (var i = 0; i < resParam.length; i++) {
            if ((!nian.test(year[i])) || year[i] == undefined || year[i] == null) {
                mui.toast('请检查您楼龄...');
                return;
            } else if ((!yuan.test(price[i])) || price[i] == undefined || price[i] == null) {
                mui.toast('请检查您估价...');
                return;
            } else if (type[i] == '' || type[i] == null || type[i] == '选择') {//|| stage[i] == undefined || stage[i] == null || stage[i] == '选择'
                mui.toast('请把信息填充完整...');
                return;
            } else {
                if (i === resParam.length - 1) {
                    params.getAjax("fcdy", resParam); //ajax
                }
            }
        }
    });
</script>
</body>

</html>